import axios from '@/utils/request'

export const getAddCart = (goodsId, goodsNum, goodsSkuId) => {
  return axios({
    url: '/cart/add',
    method: 'Post',
    data: {
      goodsId,
      goodsNum,
      goodsSkuId
    }
  })
}

export const getCartList = () => {
  return axios({
    url: '/cart/list'
  })
}

export const updateCartCount = (goodsNum, goodsId, goodsSkuId) => {
  return axios({
    url: '/cart/update',
    method: 'Post',
    data: {
      goodsNum,
      goodsId,
      goodsSkuId
    }
  })
}
export const delCart = (cartIds) => {
  return axios({
    url: '/cart/clear',
    method: 'Post',
    data: {
      cartIds
    }
  })
}
